package com.powersystem.demo.controller;


import com.powersystem.demo.entity.PsFunctionRole;
import com.powersystem.demo.mapper.PsFunctionRoleMapper;
import com.powersystem.demo.service.IPsFunctionRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author linrongji
 * @since 2019-11-28
 */
@RestController
@RequestMapping("/powersystem.demo/psFunctionRole")
public class PsFunctionRoleController {

    @Autowired
    private IPsFunctionRoleService ipfrs;

    //插入一條記錄
    @RequestMapping("addPsFunctionRole")
    public boolean addPsFunctionRole(PsFunctionRole pfr){
        return ipfrs.save(pfr);
    }

    // 根據ID修改是否啓動
    @RequestMapping("upPsFunctionRole")
    public boolean upPsFunctionRole(PsFunctionRole pfr){
        return ipfrs.updateById(pfr);
    }

    // 根據ID刪除
    @RequestMapping("delePsFunctionRole")
    public boolean delePsFunctionRole(int id){
        return ipfrs.removeById(id);
    }
}

